using System;
using System.Collections.Generic;
using MediatR;

namespace Agriculture.Api.Read.Application.Command
{
    /// <summary>
    /// 问诊单详情查询命令
    /// </summary>
    public class ConsultationOrderDetailQuery : IRequest<ConsultationOrderDetailResult>
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }
    }

    /// <summary>
    /// 问诊单详情结果
    /// </summary>
    public class ConsultationOrderDetailResult
    {
        /// <summary>
        /// 患者信息
        /// </summary>
        public PatientInfoDto Patient { get; set; } = new PatientInfoDto();

        /// <summary>
        /// 订单信息
        /// </summary>
        public ConsultOrderInfoDto OrderInfo { get; set; } = new ConsultOrderInfoDto();

        /// <summary>
        /// 接诊信息
        /// </summary>
        public ConsultInfoDto ConsultInfo { get; set; } = new ConsultInfoDto();
    }

    /// <summary>
    /// 患者信息DTO
    /// </summary>
    public class PatientInfoDto
    {
        /// <summary>
        /// 患者姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public string Gender { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 病情描述
        /// </summary>
        public string DiseaseDescription { get; set; }

        /// <summary>
        /// 就诊情况
        /// </summary>
        public string MedicalSituation { get; set; }

        /// <summary>
        /// 预约时间
        /// </summary>
        public DateTime? AppointmentTime { get; set; }

        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime SubmitTime { get; set; }
    }

    /// <summary>
    /// 问诊订单信息DTO
    /// </summary>
    public class ConsultOrderInfoDto
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 订单类型
        /// </summary>
        public string OrderType { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public string OrderStatus { get; set; }

        /// <summary>
        /// 应付金额
        /// </summary>
        public decimal PayableAmount { get; set; }

        /// <summary>
        /// 优惠券
        /// </summary>
        public decimal CouponAmount { get; set; }

        /// <summary>
        /// 实际支付
        /// </summary>
        public decimal ActualPayment { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        public string PaymentMethod { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }

        /// <summary>
        /// 退诊原因
        /// </summary>
        public string RefundReason { get; set; }

        /// <summary>
        /// 退还金额
        /// </summary>
        public decimal? RefundAmount { get; set; }
    }

    /// <summary>
    /// 问诊信息DTO
    /// </summary>
    public class ConsultInfoDto
    {
        /// <summary>
        /// 接诊时间
        /// </summary>
        public DateTime? ConsultationTime { get; set; }

        /// <summary>
        /// 通话时长（分钟:秒）
        /// </summary>
        public string CallDuration { get; set; }

        /// <summary>
        /// 患者评分（1-5星）
        /// </summary>
        public int? PatientRating { get; set; }

        /// <summary>
        /// 患者评价
        /// </summary>
        public string PatientComment { get; set; }

        /// <summary>
        /// 问诊记录列表
        /// </summary>
        public List<ConsultRecordDto> ConsultRecords { get; set; } = new List<ConsultRecordDto>();
    }

    /// <summary>
    /// 问诊记录DTO
    /// </summary>
    public class ConsultRecordDto
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime Time { get; set; }

        /// <summary>
        /// 记录类型（文本/图片/语音/视频）
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 发送人类型（医生/患者）
        /// </summary>
        public string SenderType { get; set; }
    }
} 